<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/support/taglibs.jsp" %>


<stripes:layout-render name="/support/layout/standard.jsp" title="View Organization" page="organizations">
<stripes:layout-component name="contents">
<stripes:errors/>
<jsp:useBean id="isernManager" scope="page"
           class="edu.hawaii.myisern.model.IsernManager"/>
           
<table class="layout">
  <tr>
    <td class="layoutLeft">
      <stripes:form action="/OrganizationForm.action" id="MyForm">

      <table class="leftRightForm">
        <tr>
          <th>ID:</th>
          <td>${empty actionBean.id ? "n/a" : actionBean.id}
            <stripes:hidden name="id"/>
          </td>
        </tr>
        <tr>
          <th>Name:</th>
          <td>${actionBean.organization.name}</td>                 
        </tr>
        <tr>
          <th>Type:</th>
          <td>${actionBean.organization.type}</td>                 
        </tr>
        <tr>
          <th>Contact:</th>
          <td><stripes:link href="ResearcherForm.action" event="view">
            ${actionBean.organization.contact}
            <stripes:param name="id" value="${actionBean.organization.contact}"/>
            </stripes:link>
          </td>                 
        </tr>
        <tr>
          <th>Affiliated<br />Researchers</th>
          <td>
            <table>
              <c:forEach items="${actionBean.organization.affiliatedResearchers.affiliatedResearcher}" var="researcher"> 
              <tr><td><stripes:link href="ResearcherForm.action" event="view">
                ${researcher}
                <stripes:param name="id" value="${researcher}"/>
                </stripes:link>
              </td></tr>
              </c:forEach>  
            </table>
          </td>
        </tr>
        <tr>
          <th>Country:</th>
          <td>${actionBean.organization.country}</td>                 
        </tr>
        <tr>
          <th>Home Page:</th>
          <td><a href="${actionBean.organization.homePage}" target="_blank">${actionBean.organization.homePage}</a></td>                 
        </tr>
        <tr>
          <th>Research Description:</th>
          <td>${actionBean.organization.researchDescription}</td>                 
        </tr>                                                                                
      </table>
       
      <div class="buttons">
        <stripes:submit name="preEdit" value="Edit"/>
        <stripes:submit name="remove" value="Remove" onclick="return confirm('Are you sure you want to remove Organization ${actionBean.organization.name}?')"/>
      </div>
      </stripes:form>
    </td>
    <td class="layoutRight">
      <table class="engagedCollaborations">
        <tr><th>Engaged Collaborations:</th></tr>
        <c:forEach items="${actionBean.collaborationsByOrganization}" var="collaboration" varStatus="loop"> 
          <tr><td><stripes:link href="CollaborationForm.action" event="view">
            ${collaboration.name}
            <stripes:param name="id" value="${collaboration.name}"/>
            </stripes:link>
          </td></tr>
        </c:forEach>
      </table>
    </td>
  </tr>
</table>


</stripes:layout-component>
</stripes:layout-render>
